{% extends "user_profile/user.html" %}
{% from "macros.html" import timeago %}
<!-- user_recent.html -->
{% block profilesection %}
    {% trans %}activity{% endtrans %}
{% endblock %}
{% block usercontent %}
    <div id="user-activity-pane">
        <table id="mobile-user-activity" class="user-activity">
        {% for act in activities %}
            <tr class="user-action-{{ act.type_id }}">
                <td>
                    <table width="100%">
                        <tr>
                            <td class="timestamp">{{ timeago(act.time) }}</td>
                        </tr>
                        <tr>
                            <td class="action-type">{{ act.type }}</td>
                        </tr>
                        <tr>
                            <td class="description">
                                {% if act.is_badge %}
                                    <a href="{{act.badge.get_absolute_url()}}"
                                       title="{{ act.badge.get_type_display() }} : {% trans description=act.badge.get_description() %}{{description}}{% endtrans %}"
                                       class="medal {{ act.badge.get_css_class() }}">
                                        {% trans name=act.badge.get_name() %}{{name}}{% endtrans %}
                                    </a>
                                    {% if act.content_object.post_type == 'question' %}
                                        {% set question=act.content_object %}
                                        <span>
                                            (<a title="{{question.summary|collapse|escape}}"
                                                href="{% url question question.id %}{{question.thread.title|slugify}}"
                                                >{% trans %}source{% endtrans %}</a>)
                                        </span>
                                    {% elif act.content_object.post_type == 'answer' %}
                                        {% set answer=act.content_object %}
                                        (<a title="{{answer.text|collapse|escape}}"
                                            href="{% url question answer.thread._question_post().id %}{{answer.thread.title|slugify}}#{{answer.id}}">{% trans %}source{% endtrans %}</a>)
                                    {% endif %}
                                {% else %}
                                    <a class="question-title" href="{{ act.title_link }}">{{ act.title|escape }}</a>
                                    {% if act.summary %}<div class="revision-summary">{{ act.summary }}</div>{% endif %}
                                {% endif %}
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <hr style="margin: 0">
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        {% endfor %}
        </table>
        <table id="desktop-user-activity" class="user-activity">
        {% for act in activities %}
            <tr class="user-action-{{ act.type_id }}">
                <td class="timestamp">{{ timeago(act.time) }}</td>
                <td class="action-type">{{ act.type }}</td>
                <td class="description">
                    {% if act.is_badge %}
                        <a href="{{act.badge.get_absolute_url()}}"
                           title="{{ act.badge.get_type_display() }} : {% trans description=act.badge.get_description() %}{{description}}{% endtrans %}"
                           class="medal">
                            {% trans name=act.badge.get_name() %}{{name}}{% endtrans %}
                        </a>
                        {% if act.content_object.post_type == 'question' %}
                            {% set question=act.content_object %}
                            <span>
                                (<a title="{{question.summary|collapse|escape}}"
                                    href="{% url question question.id %}{{question.thread.title|slugify}}"
                                    >{% trans %}source{% endtrans %}</a>)
                            </span>
                        {% elif act.content_object.post_type == 'answer' %}
                            {% set answer=act.content_object %}
                            (<a title="{{answer.text|collapse|escape}}"
                                href="{% url question answer.thread._question_post().id %}{{answer.thread.title|slugify}}#{{answer.id}}">{% trans %}source{% endtrans %}</a>)
                        {% endif %}
                    {% else %}
                        <a class="question-title" href="{{ act.title_link }}">{{ act.title|escape }}</a>
                        {% if act.summary %}<div class="revision-summary">{{ act.summary }}</div>{% endif %}
                    {% endif %}
                </td>
            </tr>
        {% endfor %}
        </table>
    </div>
{% endblock %}
{% block sidebar %}{% endblock %}
<!-- end user_recent.html -->
